; Cleanup sexp things in 'lua-ts-mode'
authorjohn muhl <jm@pub.pink>
Mon, 24 Feb 2025 21:21:38 +0000 (15:21 -0600)
committerEli Zaretskii <eliz@gnu.org>
Sat, 1 Mar 2025 12:59:56 +0000 (14:59 +0200)
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove some
nonsensical entries from 'treesit-thing-settings'.
* test/lisp/progmodes/lua-ts-mode-resources/movement.erts:
Add missing tests for 'backward-sexp'.  (Bug#76534)

lisp/progmodes/lua-ts-mode.el
test/lisp/progmodes/lua-ts-mode-resources/movement.erts

index e99ab0ba82577367886c20f7d88e534c79ea1ad8..f35bdff32b11daefa0b7bba30b82c5815eafc53a 100644 (file)
@@ -798,8 +798,7 @@ Calls REPORT-FN directly."
                 `((lua
                    (function ,(rx (or "function_declaration"
                                       "function_definition")))
-                   (keyword ,(regexp-opt lua-ts--keywords
-                                         'symbols))
+                   (keyword ,(regexp-opt lua-ts--keywords 'symbols))
                    (loop-statement ,(rx (or "do_statement"
                                             "for_statement"
                                             "repeat_statement"
@@ -817,18 +816,10 @@ Calls REPORT-FN directly."
                              keyword
                              loop-statement
                              ,(rx (or "arguments"
-                                      "break_statement"
-                                      "expression_list"
-                                      "false"
-                                      "identifier"
-                                      "nil"
-                                      "number"
                                       "parameters"
                                       "parenthesized_expression"
                                       "string"
-                                      "table_constructor"
-                                      "true"
-                                      "vararg_expression"))))
+                                      "table_constructor"))))
                    (text "comment"))))
 
     ;; Imenu/Outline/Which-function.
index 11e86f1292663fafa11442fe7194706dc0ed98ac..6e2ffb21d0eeaab7e7caa46981741eff5ce35fd6 100644 (file)
@@ -436,9 +436,9 @@ function f(a, b)| end
 Name: forward-sexp moves over strings
 
 =-=
-print("|1, 2, 3")
+print(|"1, 2, 3")
 =-=
-print("1, 2, 3|")
+print("1, 2, 3"|)
 =-=-=
 
 Name: forward-sexp moves over tables
@@ -557,9 +557,9 @@ function f|(a, b) end
 Name: backward-sexp moves over strings
 
 =-=
-print("1, 2, 3|")
+print("1, 2, 3"|)
 =-=
-print("|1, 2, 3")
+print(|"1, 2, 3")
 =-=-=
 
 Name: backward-sexp moves over tables
@@ -601,3 +601,53 @@ end|
     end
 end
 =-=-=
+
+Name: backward-sexp moves over do statements
+
+=-=
+do
+  print(a + 1)
+end|
+=-=
+|do
+  print(a + 1)
+end
+=-=-=
+
+Name: backward-sexp moves over for statements
+
+=-=
+for k,v in pairs({}) do
+  print(k, v)
+end|
+=-=
+|for k,v in pairs({}) do
+  print(k, v)
+end
+=-=-=
+
+Name: backward-sexp moves over repeat statements
+
+=-=
+repeat
+  n = n + 1
+until n > 10|
+=-=
+|repeat
+  n = n + 1
+until n > 10
+=-=-=
+
+Name: backward-sexp moves over while statements
+
+=-=
+while n < 99
+do
+  n = n+1
+end|
+=-=
+|while n < 99
+do
+  n = n+1
+end
+=-=-=